<template>
    <pageTabelLayout>
    
        <template #pageHeader>
            <div class="my-header">
                <!-- <QrcodeVue :value="is"></QrcodeVue> -->
                <div class="search-form isheader" v-if="headerShow">
                    <div>
                        <a-form size="mini" :model="queryData" layout="inline">
                            <a-form-item label="类型编号">
                                <!-- <a-select popup-container="html"  class="bacClass" v-model="queryData.firm">
                    <a-option v-for="item in pageData.gcList" :value="item.id">{{ item.name }}</a-option>
                </a-select> -->
                                <a-select popup-container="html"  class="bacClass" :style="{ width: '160px' }" :loading="loading1"
                                    @search="handleSearch1" :filter-option="false" allow-search
                                    v-model.trim="queryData.typeCode" @click="handleSearchs" allow-clear>
                                    <a-option v-for="item in pageData.typeCode" :value="item.typeCode">{{
                                        item.typeCode
                                    }}</a-option>
                                </a-select>

                            </a-form-item>
                            <a-form-item label="类型名称">
                                <!-- <a-select popup-container="html"  class="bacClass" :options="pageData.clothList" v-model="queryData.clothType" :style="{ width: '150px' }"> -->
                                <!-- <a-option  value="">全部</a-option>
                    <a-option v-for="(item,index) in pageData.clothList" :value="item.code" :key="index">{{item.code}}</a-option> -->
                                <!-- </a-select> -->
                                <a-select popup-container="html"  class="bacClass" :style="{ width: '160px' }" :loading="loading"
                                    @search="handleSearch" :filter-option="false" allow-search
                                    v-model.trim="queryData.typeName" @click="handleSearchs1" allow-clear>
                                    <a-option v-for="item in pageData.typeName" :value="item.typeName">{{
                                        item.typeName
                                    }}</a-option>
                                </a-select>
                            </a-form-item>
                        </a-form>
                    </div>
                    <div class="my-tool-bar">
                        <Toolbar :items="[
                            `${permissionStore.hasPermisson('cklx.cx') ? '查询' : ''}`,
                            // `${permissionStore.hasPermisson('cklx.xz') ? '新增' : ''}`,
                            // `${permissionStore.hasPermisson('cklx.sc') ? '删除' : ''}`,
                            `${permissionStore.hasPermisson('cklx.dc') ? '导出' : ''}`]" @select="selectHandler"
                            @add="addHandler" @del="deleteHandler" @export="exports">
                        </Toolbar>
                    </div>
                </div>


                <div class="my-divisders">
                    <a-divider orientation="center">
                        <icon-double-up v-if="headerShow" @click="headerShow = false" :strokeWidth="2" :size="18" />
                        <icon-double-down v-else @click="headerShow = true" :strokeWidth="2" :size="18" />
                    </a-divider>
                </div>
                <!-- <div class="my-tool-bar">
                    <Toolbar :items="['查询', '新增', '删除', '导出']" @select="selectHandler" @add="addHandler"
                        @del="deleteHandler" @export="exports">
                    </Toolbar>
                </div> -->
            </div>
            <div class="gang"></div>
        </template>

        

        <template #pageTabel>
            <!-- <a-table :style="{ height: '100%' }" size="mini" @page-change="pagination.change" stripe :bordered="true"
                :columns="tableColumns" :row-selection="{ showCheckedAll: true, width: 50, onlyCurrent: true }"
                v-model:selected-keys="selectedRowKeys" :loading="table.tableLoading" :data="table.dataList"
                :pagination="pagination" :rowKey="rowKey">
                <template #obsoleteState="{ record }">
                    <a-switch checked-color="#F53F3F" unchecked-color="#14C9C9" disabled v-model="record.obsoleteState"
                        :checked-value="1" :unchecked-value="0">
                        <template #checked>
                            <span style="color:#fff">是</span>
                        </template>
                        <template #unchecked>
                            <span style="color:#fff">否</span>
                        </template>
                    </a-switch>
                </template>
                <template #edit="{ record }">
                    <a-space>
                        <a-button type="primary" size="small" status="warning" @click="editHandler(record)">
                            <template #icon>
                                <icon-edit />
                            </template>
                            修 改
                        </a-button> -->
            <!-- <a-button status="success" @click="openQRcode(record)">查看二维码</a-button> -->
            <!-- </a-space>
                </template>
            </a-table> -->
            <a-spin :loading="pageData.pageLoading" style="width: 100%;height: 100%;">
            <AgGridVuesCopys :rowHeight="33" :headerHeight="33" :suppressCopyRowsToClipboard="true" :suppressDragLeaveHidesColumns="true" rowSelection="multiple"
                @grid-ready="gridReady" @columnResized="onColumnResized" @columnMoved="onColumnMoved"
                @columnVisible="onColumnVisible" style="height: calc(100% - 45px);" :defaultColDef="defaultColDef" class='ag-theme-alpine'
                :rowData="table.dataList" :columnDefs="tc" :localeText="localeText1"></AgGridVuesCopys>
            <paginationCopys :page-size-options="pagingList1" :total="total" show-total show-jumper show-page-size
                @change="PageSize" @page-size-change="change1" style="justify-content: center" :page-size="size"
                :current="page" />
            </a-spin>
        </template>
   
    <a-drawer ok-text='保存' cancel-text='关闭' :drawer-style="{ 'zIndex': 9999 }" :mask-closable="false" :width="400"
        :visible="pageData.showAdd" unmountOnClose @ok="sideOk" @cancel="sideNo">
        <template #title>
            {{ pageData.sideTitle }}
        </template>
        <div>
            <!-- 所属工厂 仓库名称 联系人 联系电话 地址 -->
            <a-form ref="formRef" :model="dataForm">
                <!-- <a-form-item label="所属公司" field="code">
                    <a-select popup-container="html"  class="bacClass" v-model="dataForm.firm">
                        <a-option>掌紫元</a-option>
                    </a-select>
                </a-form-item> -->
                <a-form-item label="类型编号" field="typeCode"
                    :rules="[{ validator: isChiese }, { required: true, message: '类型编号必填' }]" label-col-flex="80px">
                    <a-input class="bacClass" placeholder="" @blur="inputBlur" v-model.trim="dataForm.typeCode" />
                </a-form-item>
                <a-form-item label="类别名称" field="typeName" :rules="[{ required: true, message: '类别名称必填' }]"
                    :validate-trigger="['change', 'blur']" label-col-flex="80px">
                    <a-input class="bacClass" placeholder="" v-model.trim="dataForm.typeName" />
                </a-form-item>
                <a-form-item label="备注" field="remark" label-col-flex="80px">
                    <a-textarea class="bacClass" placeholder="" v-model="dataForm.remark" :max-length="400" allow-clear
                        show-word-limit />
                </a-form-item>
                <a-form-item label-col-flex="80px" label="作废状态" field="obsoleteState" v-if="pageData.sideTitle == '修改仓库信息'">
                    <a-switch checked-color="#F53F3F" unchecked-color="#14C9C9" v-model="dataForm.obsoleteState"
                        :checked-value="Number(1)" :unchecked-value="Number(0)">
                        <template #checked>
                            <span style="color:#fff">是</span>
                        </template>
                        <template #unchecked>
                            <span style="color:#fff">否</span>
                        </template>
                    </a-switch>
                </a-form-item>
            </a-form>
        </div>
    </a-drawer>
    <ModalDialog :mask-closable="false" ref="qrModal" title="仓库二维码" @confirm="gbModal">
        <template #content>
            <a-space direction="vertical">
                <a-button type="primary" @click="print">打印</a-button>
                <div id="category">
                    <QrcodeVue :value="qrData.code"></QrcodeVue>
                    <div style="display:inline-block;vertical-align:top;margin-left:15px">
                        <span>工厂名称 {{ qrData.gcName }}</span>
                        <br />
                        <span>仓库名称 {{ qrData.ckName }}</span>
                    </div>
                </div>
            </a-space>
        </template>
    </ModalDialog>
</pageTabelLayout>
</template>

<script lang="ts">
import { post } from '@/api/http'
import { useTable, useRowKey, useTableColumn, usePagination, useRowSelection } from '@/hooks/table';
import QrcodeVue from 'qrcode.vue'
import printJS from 'print-js'
import { ModalDialogType } from '@/types/components'
import { ref, reactive, onMounted, toRefs, defineComponent } from 'vue'
import Toolbar from '@/components/Toolbar.vue';
import { Form, Message, Modal } from '@arco-design/web-vue'
import { FormInstance } from '@arco-design/web-vue/es/form'
import ModalDialog from '@/components/ModalDialog.vue'

import { localeText } from '@/api/aggridZw'
import usePermission from '@/store/modules/permission'
import { pagingList } from '@/api/paging'
import { saveOrUpdateGridState as saveOrUpdateGridState01 } from '@/hooks/useGridState'
interface Firm {
    name: string,
    id: number
}
interface Cloth {
    code: string,
}
interface WareHouseInfo {
    "id": any,
    "firm": any,
    "typeCode": any,
    "typeName": any,
    "byThePieceWay": any,
    "remark": any,
    "deleteState": any,
    "createName": any,
    "createTime": any,
    "updateName": any,
    "updateTime": any,
    "obsoleteState": number,

}
export default {
    name: "WarehouseCategory",
    setup() {
        const pagingList1: any = ref(pagingList)
        const permissionStore: any = usePermission()
        // typeName:queryData.typeName,
        // typeCode:queryData.typeCode
        onMounted(() => {
            doRefresh();
            pageData.rHeight = document.getElementsByClassName("main-section")[0]?.clientHeight
            //弹出层的高
            if (pageData.rHeight !== undefined) {
                pageData.rHeight = pageData.rHeight - 100;
            }
        })
        const total = ref(10);
        const page = ref(1);
        const size = ref(10);
        function PageSize(val: any) {
            page.value = val
            doRefresh();
        }
        function change1(val: any) {
            size.value = val
            doRefresh();
        }
        function doRefresh() {
            pageData.pageLoading = true
            updateGridState01()
            post({
                url: "wms/warehouseType/getWarehoursTypePage",
                data: {
                    page: page.value,
                    size: size.value,
                    typeName: queryData.typeName,
                    typeCode: queryData.typeCode
                },
            })
                .then(({ data, code }: any) => {
                    if (code === 200) {
                        table.handleSuccess(data.list);
                        gridOption.value.setRowData(data.list);
                        pagination.setTotalSize(data.total);
                        total.value = data.total
                    }
                })
                .catch(console.log).finally(() => {
                    pageData.pageLoading = false
                })
        }
        const { selectedRowKeys, onSelectionChange } = useRowSelection();
        const pagination = usePagination(doRefresh);
        const table = useTable();
        const rowKey = useRowKey("id");

        //input离开焦点 将小写转大写
        const inputBlur = () => {
            dataForm.typeCode = dataForm.typeCode.toUpperCase();
        }
        //假数据后期需要修改
        // const dataList = reactive({
        //     list:[{
        //         id:1,
        //         code:1,
        //         mercery_name:'掌紫元',
        //         remark:"WH22101800000002",
        //         remark_1:'裁断中仓',
        //         remark_2:'佛山',
        //         remark_3:'勇哥',
        //         remark_4:'110'
        //     }]
        // })

        const changelx = () => {
            console.log(1)
        }


        let qrModal = ref<ModalDialogType | null>(null);
        const qrData = reactive({
            ckName: "",
            gcName: "",
            code: ""
        });
        const openQRcode = (item: any) => {
            qrData.gcName = item.mercery_name;
            qrData.ckName = item.remark_1;
            qrData.code = JSON.stringify({ id: item.id, firm: encodeURI(item.remark), warhouse: encodeURI(item.remark), code: item.code })
            qrModal.value?.toggle();
        };
        // 序号	所属工厂	仓库编码	仓库名称	仓库地址	联系人	联系电话	操作
        const tableColumns = useTableColumn([

            {
                title: "类型编号",
                key: "typeCode",
                dataIndex: "typeCode",
                width: 150,
            },
            {
                title: "类型名称",
                key: "typeName",
                dataIndex: "typeName",
                width: 150,
            },
            {
                title: "备注",
                key: "remark",
                dataIndex: "remark",
                width: 150,
            },
            {
                title: "作废状态(是/否)",
                key: "obsoleteState",
                dataIndex: "obsoleteState",
                slotName: 'obsoleteState',
                width: 150,
            },
            {
                title: "创建人",
                key: "createName",
                dataIndex: "createName",
                width: 150,
            },
            {
                title: "创建时间",
                key: "createTime",
                dataIndex: "createTime",
                width: 150,
            },
            {
                title: "修改人",
                key: "updateName",
                dataIndex: "updateName",
                width: 150,
            },
            {
                title: "修改时间",
                key: "updateTime",
                dataIndex: "updateTime",
                width: 150,
            },
            // {
            //     title: "操作",
            //     key: "edit",
            //     dataIndex: "edit",
            //     slotName: 'edit',
            //     width: 150, fixed: 'right'
            // },
        ]);
        const pageData: any = reactive<{
            gcList: Firm[];
            clothList: Cloth[];
            showAdd: boolean,
            sideTitle: string,
            typeName: [],
            typeCode: [],
            pageLoading: any,
            rHeight: any
        }>({
            gcList: [],
            clothList: [],
            showAdd: false,
            sideTitle: '新增布料基础资料',
            typeName: [],
            typeCode: [],
            pageLoading: false,
            rHeight: 0
        });

        const selectHandler = () => {
            page.value = 1
            doRefresh();
        }
        // onMounted(() => {
        //     doRefresh();
        // });
        const queryData = reactive({
            typeName: "",
            typeCode: ""
        });
        const addHandler = () => {
            queryData.typeCode = ''
            queryData.typeName = ''
            for (let item in dataForm) {
                dataForm[item] = ''
            }
            pageData.showAdd = true
            pageData.sideTitle = '新增仓库类型'

        }
        const dataForm = reactive<WareHouseInfo>({
            "id": "",
            "firm": "",
            "typeCode": "",
            "typeName": "",
            "byThePieceWay": "",
            "remark": "",
            "deleteState": "",
            "createName": "",
            "createTime": "",
            "updateName": "",
            "updateTime": "",
            "obsoleteState": 0
        })
        const formRef = ref<FormInstance>()
        const sideOk = () => {
            formRef.value?.validate().then((err) => {
                if (!err) {
                    let dataForms = {
                        typeName: dataForm.typeName,
                        typeCode: dataForm.typeCode,
                        remark: dataForm.remark,
                        // obsoleteState:dataForm.obsoleteState
                    }
                    let dataForms1 = {
                        id: ids,
                        firm: dataForm.firm,
                        typeName: dataForm.typeName,
                        typeCode: dataForm.typeCode,
                        remark: dataForm.remark,
                        obsoleteState: dataForm.obsoleteState
                    }
                    if (pageData.sideTitle == '新增仓库类型') {

                        post({
                            url: 'wms/warehouseType/addWarehouseType',
                            data: [dataForms]
                        }).then((res: any) => {
                            if (res.code === 200) {
                                formRef.value?.resetFields()
                                queryData.typeName = dataForm.typeName,
                                    queryData.typeCode = dataForm.typeCode,
                                    doRefresh()
                                pageData.showAdd = false
                                Message.success({
                                    content: '添加成功',
                                    duration: 5000
                                })
                            } else {
                                Message.error({
                                    content: res.message,
                                    duration: 5000
                                })
                            }
                        })
                    } else if (pageData.sideTitle == '修改仓库信息') {
                        console.log(dataForms1)
                        post({
                            url: 'wms/warehouseType/updateWarehouseType',
                            data: [dataForms1]
                        }).then((res: any) => {
                            if (res.code === 200) {
                                formRef.value?.resetFields()
                                doRefresh()
                                pageData.showAdd = false
                                Message.success({
                                    content: '修改成功',
                                    duration: 5000
                                })
                            } else {
                                Message.error({
                                    content: res.message,
                                    duration: 5000
                                })
                            }
                        })
                    }
                }

            })
        }
        const sideNo = () => {
            pageData.showAdd = false
        }

        var ids = ''
        const editHandler = (key: any) => {
            dataForm.firm = key.firm
            dataForm.typeCode = key.typeCode
            dataForm.typeName = key.typeName
            dataForm.remark = key.remark
            dataForm.obsoleteState = key.obsoleteState
            pageData.showAdd = true
            pageData.sideTitle = '修改仓库信息'
            ids = key.id
        }
        const deleteHandler = () => {
            if (gridOption.value.getSelectedRows().length === 0) {
                return
            }
            let wouseAarry: any = []
            gridOption.value.getSelectedRows().forEach((item: any) => {
                wouseAarry.push({
                    id: item.id
                })
            })
            Modal.confirm({
                title: '系统提示',
                content: '确认删除选中的数据?',
                onOk() {
                    post({
                        url: 'wms/warehouseType/delWarehouseType',
                        data: wouseAarry
                    }).then(({ code, data }: any) => {
                        if (code === 200) {
                            doRefresh()
                            pageData.showAdd = false
                            Message.success({
                                content: '删除成功',
                                duration: 5000
                            })
                        } else {
                            Message.error({
                                content: '删除失败',
                                duration: 5000
                            })
                        }
                    })
                }
            })
        }
        const print = () => {
            printJS({
                printable: 'category',
                type: 'html',
                targetStyles: ['*'],
            })
        }
        const gbModal = () => {
            qrModal.value?.toggle()
        }
        const options = ref<any>(pageData.typeName);
        const options1 = ref<any>(pageData.typeCode);
        const loading = ref(false);
        const loading1 = ref(false);
        const handleSearch = (value: any) => {
            if (value) {
                const ob = { typeName: value }
                loading.value = true;
                window.setTimeout(() => {
                    selCxAll(ob);
                    options.value = pageData.typeName;
                    loading.value = false;
                }, 100)
            } else {
                options.value = []
            }
        };
        const handleSearch1 = (value: any) => {
            if (value) {
                const ob = { typeCode: value }
                loading1.value = true;
                window.setTimeout(() => {
                    selCxAll1(ob);
                    options1.value = pageData.typeCode
                    loading1.value = false;
                }, 100)
            } else {
                options.value = []
            }
        };
        function selCxAll(val: any) {
            post({
                url: "wms/warehouseType/getFieldValue",
                data: val
            }).then(({ data, code }: any) => {
                if (code === 200) {
                    console.log(data)
                    pageData.typeName = data;
                } else {
                    Message.error({
                        content: "查询失败！",
                        duration: 5000,
                    });
                }
            });
        }
        function selCxAll1(val: any) {
            post({
                url: "wms/warehouseType/getFieldValue",
                data: val
            }).then(({ data, code }: any) => {
                if (code === 200) {
                    console.log(data)
                    pageData.typeCode = data;
                } else {
                    Message.error({
                        content: "查询失败！",
                        duration: 5000,
                    });
                }
            });
        }
        const exports = () => {
            if (gridOption.value.getSelectedRows().length === 0) {
                Message.error('请先勾选')
                return
            } else {
                //将表头拼接出来
                let head = "<th>类型编号</th><th>类型名称</th><th>备注</th><th>作废状态(是/否)</th><th>创建人</th><th>创建时间</th><th>修改人</th><th>修改时间</th>"
                //拿到当前表格数据与勾选的行做筛选
                let nowRow = table.dataList.filter(function (o) {
                    return (gridOption.value.getSelectedRows().map((o: any) => { return o.id })).indexOf(o["id"]) !== -1;
                })
                let body = "";
                nowRow.forEach(function (o) {
                    body += "<tr><td>" + o["typeCode"] + "</td>";
                    body += "<td>" + o["typeName"] + "</td>";
                    body += "<td>" + o["remark"] + "</td>";
                    body += "<td>" + (o["obsoleteState"] === 0 ? "否" : "是") + "</td>";
                    body += "<td>" + o["createName"] + "</td>";
                    body += "<td>" + o["createTime"] + "</td>";
                    body += "<td>" + o["updateName"] + "</td>";
                    body += "<td>" + o["updateTime"] + "</td>";
                    body += "</tr>";
                })
                tableToXlsx(head, '仓库类型', body)
                console.log(table)
            }
        }

        function tableToXlsx(head: any, filename: any, body: any) {
            const uri = 'data:application/vnd.ms-excel;base64,',
                template = `<html>
            <head><meta charset="UTF-8"></head>
            <body><table border="1"><tr>${head}</tr>${body}</table></body>
        </html>`;

            const a = document.createElement('a');
            a.href = uri + window.btoa(unescape(encodeURIComponent(template)));
            a.download = filename;
            a.click();
            document.removeChild(a);
        }
        const handleSearchs = () => {
            post({
                url: "wms/warehouseType/getFieldValue",
                data: {
                    typeCode: ''
                }
            }).then(({ data, code }: any) => {
                if (code === 200) {
                    pageData.typeCode = data;
                } else {
                    Message.error({
                        content: "查询失败！",
                        duration: 5000,
                    });
                }
            });
        }
        const handleSearchs1 = () => {
            post({
                url: "wms/warehouseType/getFieldValue",
                data: {
                    typeName: ''
                }
            }).then(({ data, code }: any) => {
                if (code === 200) {
                    pageData.typeName = data;
                } else {
                    Message.error({
                        content: "查询失败！",
                        duration: 5000,
                    });
                }
            });
        }
        const isChiese = (value: string, cb: Function) => {
            return new Promise<void>(resolve => {
                if (window.encodeURI(value).indexOf('%') !== -1) {
                    cb('填写的值不能包含中文！')
                }
                resolve()
            })

        }
        const headerShow = ref<boolean>(true)
        let is = ref(JSON.stringify({ firm: encodeURI("集团"), storey: encodeURI("1F"), planOrderCode: encodeURI("2022111800003"), greyCode: encodeURI("1"), weaveCode: encodeURI("2022111800003"), houseNo: encodeURI("1"), clothfiyCode: encodeURI("001"), }))
        const gridOption = ref()
        const colState = ref()
        const gridReady = (params: any) => {
            gridOption.value = params.api
            colState.value = params.columnApi
        }
        const defaultColDef = {
            sortable: true,
            resizable: true,
            filter: true,
        }
        let tc: any[] = tableColumns.map((o: any) => {

            let obj = {
                headerName: o.title,
                field: o.key,
                pinned: o['fixed'],

            }
            // if (o.slotName === 'edit') {
            //     obj['resizable'] = false
            //     obj['filter'] = false
            //     obj['sortable'] = false
            //     obj["lockPosition"] = "right"
            //     obj['width']=140
            //     obj['cellRenderer'] = {
            //         template: `
            //         <a-space>
            //             <a-button v-if="e" style="position:relative;left:10px" type="primary" size="small" status="warning" @click="a1">
            //                 <template #icon>
            //                     <icon-edit />
            //                 </template>
            //                 修 改
            //             </a-button>
            //                 </a-space>

            //         `,
            //         setup(props: any) {
            //             const isDtas = ref(props.params.data)
            //             const a1 = () => {
            //                 editHandler(props.params.data)
            //             }
            //             return {
            //                 a1, isDtas,
            //                 e:permissionStore.hasPermisson('cklx.xg')
            //             }
            //         }
            //     }
            // }
            if (o.slotName === 'obsoleteState') {
                obj['resizable'] = false
                obj['filter'] = false
                obj['sortable'] = false
                // obj["lockPosition"] = "right"
                obj["width"] = 150
                obj['cellRenderer'] = {
                    template: `<a-switch checked-color="#F53F3F" unchecked-color="#14C9C9" disabled v-model="isDatas.obsoleteState"
                        :checked-value="1" :unchecked-value="0">
                        <template #checked>
                            <span style="color:#fff">是</span>
                        </template>
                        <template #unchecked>
                            <span style="color:#fff">否</span>
                        </template>
                    </a-switch>`,
                    setup(props: any) {
                        const isDatas = ref(props.params.data)
                        return {
                            isDatas
                        }
                    }
                }
            }
            if (o.slotName === 'infoState') {
                obj['resizable'] = false
                obj['filter'] = false
                obj['sortable'] = false
                obj["lockPosition"] = "right"
                obj["width"] = 100
                obj['cellRenderer'] = {
                    template: `
                            <a-button v-if="(isDatas.infoState == 0)" status="success" size="mini" disabled>待入库
                            </a-button>
                            <a-button v-if="(isDatas.infoState == 1)" type="primary" size="mini" status="danger"
                                disabled>已入库
                            </a-button>`,
                    setup(props: any) {
                        const isDatas = ref(props.params.data)
                        return {
                            isDatas
                        }
                    }
                }
            }
            return obj
        })

        let a = [{
            showRowGroup: 'hide_def',
            "headerName": "",
            "checkboxSelection": true,
            "headerCheckboxSelection": true,
            "pinned": "left",
            "width": 50,
            resizable: false,
            filter: false,
            sortable: false,
            minWidth: 50,
            maxWidth: 50,
            lockPosition: "left",
        }]
        tc = a.concat(tc)
        const localeText1: any = ref(localeText)
        const { saveGridState: saveGridState01, updateGridState: updateGridState01 } = saveOrUpdateGridState01('WarehouseCategory-1', gridOption, colState, tc)
        const onColumnMoved = () => {
            saveGridState01()
        }
        const onColumnResized = () => {
            saveGridState01()
        }
        const onColumnVisible = () => {
            saveGridState01()
        }
        return {
            saveOrUpdateGridState01,
            saveGridState01,
            updateGridState01,
            onColumnMoved,
            onColumnResized,
            onColumnVisible,
            colState,
            pagingList1,
            localeText1,
            change1,
            PageSize,
            total,
            page,
            size,
            tc,
            defaultColDef,
            gridReady,
            gridOption,
            is,
            isChiese,
            handleSearchs1,
            handleSearchs,
            exports,
            selectHandler,
            gbModal,
            print,
            editHandler,
            sideNo,
            deleteHandler,
            sideOk,
            formRef,
            dataForm,
            addHandler,
            selectedRowKeys,
            pagination,
            tableColumns,
            table,
            rowKey,
            pageData,
            queryData,
            qrModal,
            qrData,
            openQRcode,
            inputBlur,
            changelx,
            loading,
            handleSearch,
            handleSearch1,
            loading1,
            headerShow,
            permissionStore
        };
    },
    components: { Toolbar, QrcodeVue, ModalDialog,  }
}
</script>
<style scoped>
:deep(.ag-cell-value) {
    user-select: initial;
    -moz-user-select: text;
    -ms-user-select: text;
    -webkit-user-select: text;
}

:deep(.ag-cell) {
    border-right: 1px solid #dde2eb;
}

:deep(.ag-header-cell) {
    border-right: 1px solid #dde2eb;
}
</style>